﻿<UserControl x:Class="HeritageAcademy.Window.ResultsScreenView"
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	xmlns:Shared="clr-namespace:HeritageAcademy.Shared"
    xmlns:Resources="clr-namespace:HeritageAcademy.Window.Resources"
	mc:Ignorable="d"
	UseLayoutRounding="True"
	d:DesignWidth="640" d:DesignHeight="480">

	<Grid x:Name="grid" Background="#FFFFCC70">

        <RepeatButton x:Name="ReturnBackButton" Style="{DynamicResource OpacityRepeatButton}" Focusable="True" HorizontalContentAlignment="Left" VerticalContentAlignment="Center" Cursor="Hand" Padding="18,0,0,0" ToolTip="{x:Static Resources:Strings.Window_GoBack}" Width="100" Height="40" Margin="0,-40,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" d:LayoutOverrides="Width">
			<Shared:Bitmap Source="/HeritageAcademy.Window;component/Resources/Images/arrow_back.png" />
		</RepeatButton>
		
        <Grid Margin="20" Background="White">		
            <Grid.RowDefinitions>
				<RowDefinition Height="50"/>
				<RowDefinition/>
				<RowDefinition Height="50"/>
			</Grid.RowDefinitions>
			
            <!-- Shadow of the results list -->
            <Grid.Effect>
				<DropShadowEffect BlurRadius="10" ShadowDepth="0" Opacity="0.35"/>
			</Grid.Effect>
			
            <!-- Title -->
            <TextBlock x:Name="tbResultsTitle" Text="{x:Static Resources:Strings.Results_Title}" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="18.667"/>
            
            <!-- Result list -->
            <ScrollViewer x:Name="svResults" HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto" CanContentScroll="True" Grid.Row="1" HorizontalAlignment="Center">
                <ItemsControl x:Name="ResultsItems" ItemsSource="{Binding Results}">
                    <ItemsControl.ItemTemplate>
                        <DataTemplate>
                            <Label Content="{Binding .}" FontWeight="Normal" FontSize="12" Margin="0">
                                <Label.ContentTemplate>
                                    <DataTemplate>
                                        <Grid HorizontalAlignment="Center" >
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition/>
                                                <ColumnDefinition/>
                                                <ColumnDefinition/>
                                                <ColumnDefinition/>
                                            </Grid.ColumnDefinitions>
                                            <TextBlock Grid.Column="0" FontSize="14" Text="{Binding Path=PageNumber, StringFormat={x:Static Resources:Strings.Results_Qtn}}" />
                                            <TextBlock Grid.Column="1" FontSize="14" Text="{Binding Path=Time, StringFormat=' ({0})'}" />
                                            <TextBlock Grid.Column="2" FontSize="14" Text="......................" Margin="4,0,4,0" />
                                            <TextBlock Grid.Column="3" FontSize="14" Text="{Binding Path=Status}" />
                                        </Grid>
                                    </DataTemplate>
                                </Label.ContentTemplate>
                            </Label>
                        </DataTemplate>
                    </ItemsControl.ItemTemplate>
                </ItemsControl>
            </ScrollViewer>
            
            <!-- Statistics -->
            <StackPanel Orientation="Horizontal" Grid.Row="2" d:LayoutOverrides="Width" HorizontalAlignment="Center" VerticalAlignment="Center">
                <TextBlock Text="{x:Static Resources:Strings.Results_True}" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="18.667"/>
            	<TextBlock Text="{Binding NumberOfRightAnswers}" FontSize="18.667" Margin="8,0"/>
                <TextBlock Text="{x:Static Resources:Strings.Results_False}" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="18.667"/>
            	<TextBlock Text="{Binding NumberOfWrongAnswers}" FontSize="18.667" Margin="8,0,0,0"/>
            </StackPanel>
        </Grid>
	</Grid>
</UserControl>